#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int n = 0, a[10][10] = { 0 };
    int i = 0, j = 0, k = 0, x = 0, y = 0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            scanf("%d", &a[i][j]);
        }
    }
    for (i = 0; i < n; i++)
    {
        int max = a[i][0];
        for (j = 0; j < n; j++)
        {
            if (max <= a[i][j])
            {
                max = a[i][j];
                y = j;
            }
        }
        for (k = 0; k < n; k++)
        {
            if (max > a[k][y])
                break;
        }
        if (k == n)
        {
            printf("%d %d\n", i, y);
            break;
        }
    }
    if (y == 0)
        printf("NONE");

    return 0;
}